﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Program05._1
{
    public class Course1
    {
        public string Name { get; set; }
        private int period;
        public int Period
        {
            get => period;
            set => period=value < 0 ? 0 : value;
        }
        private int creidt;
        public int Creidt
        {
            get => creidt;
            set => creidt= value < 0 ? 0 : value;
        }
        private int score;
        public int Score
        {
            get => score;
            set => score = value < 0 ? 0 : value;
        }
        public override string ToString() => $"课程：{Name},学时：{Period},学分:{Creidt},成绩：{Score}";
     
    }
}
